package com.lezijie.seckill.service;

import com.lezijie.seckill.pojo.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lezijie.seckill.vo.LoginVO;
import com.lezijie.seckill.vo.RespBean;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * UserService接口
 * @author SunZhiPeng
 * @since 2021-10-23
 */
public interface IUserService extends IService<User> {

    /**
     * 登录功能
     * @param loginVO 登录参数
     * @param request
     * @param response
     * @return RespBean对象，登录成功或者失败参数
     */
    RespBean doLogin(LoginVO loginVO, HttpServletRequest request, HttpServletResponse response);

    /**
     * 根据Cookie获取用户
     * @param userTicket 用户ticket
     * @param request 四大作用域 request
     * @param response 响应response
     * @return 用户
     */
    User getUserByCookie(String userTicket,HttpServletRequest request, HttpServletResponse response);
}
